﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace SSTrafficStatistics
{
    class HideOnStartupApplicationContext : ApplicationContext
    {
        private Form mainFormInternal = null;
        public HideOnStartupApplicationContext(Form main)
        {
            this.mainFormInternal = main;
            if (mainFormInternal != null)
            {
                this.mainFormInternal.Show();
                mainFormInternal.FormClosed += MainFormInternal_FormClosed;
            }
        }

        private void MainFormInternal_FormClosed(object sender, FormClosedEventArgs e)
        {
            Application.Exit();
        }
    }
}
